// pub mod qr_code_util;
// pub mod sys;
pub mod local;



#[cfg(test)]
mod tests {
    use std::collections::HashMap;

    use super::*;
    use log::info;
    use tokio::runtime::Runtime;
    #[test]
    fn get_item_type(){
        // utils::log_config::init_log_config();
        let rt = Runtime::new().unwrap();
        let cookie = "ul_utk=MjNzZjNkd2lvfFAwWmtxRFNhbW14ZzFEcWhvRGkrMUp1QnYvSDZVSU1zTDJ5ZjRvMEc4R2JJS0J5cFg4NGlHVGdjQlNmTEtGeitxS0FrQ2lVQTFvYzY1eGExVVMza0UrdGdYcHpBTFhUV2s4ZE1uaEJWS0prcXlTa1hlQjBHem1JUGpaQXVXdGF0TFRIQ1Nrc2hOejlrRnQzRktQclgwS3phelljK09nSmF5U29tWEtUb3d2Yz18OXpRVDJraG9JR3N5dURjR2xqNmZrRWJZSzNPamhiamxpTGc1ekV6Z1p0MjhjaEZRdHl5QzRXMDNXR0JKajduZmR3aSsrSERhQXA4djRnUUZsTklRallJcjBwUEc0Z3FyVXlFSDVkWDc3Njg5YWZ1M0lQR2JueXJDWXlTQitzUnZmMlJobWRVOGNxOTBkbzBicFdSbU1pcW8yQW4wQ0NDRHN1U3NtYzdKRG00K2ZaZm8xNkl4cDcrZDE3QUhrY2MzcDdZSTBvT01ydnVRWVYwN3VtL2F0cXJ0U1V5ejFieEE=;ul_zid=2362%23%E4%B8%8A%E6%B5%B7%E5%B8%82%E6%B5%A6%E4%B8%9C%E6%96%B0%E5%8C%BA%E9%82%AE%E6%94%BF%E5%B1%80%7C";
        let mut headers:HashMap<String,String> = HashMap::new();
        headers.insert("cookie".to_string(), cookie.to_string());
        // let url = "https://vps-api.ule.com/ulgmall-product/itemQuery/eslist/0/10?villageNo=94330265";
        // let url = "https://vps-api.ule.com/ulgmall-product/vps/itemManage/itemCopy";
        let url = "https://vps-api.ule.com/dataexchange/yzg-client/pull/ITEM?searchAfter=0&&searchAfter2=0";
        let mut data = HashMap::<String,String>::new();
        data.insert("villageNo".to_string(),"94330265".to_string());
        data.insert("pageNum".to_string(),"1".to_string());
        data.insert("pageSize".to_string(),"10".to_string());
        // data.insert("searchAfter".to_string(),"0".to_string());
        data.insert("ip".to_string(),"0.0.0.0".to_string());
        data.insert("mac".to_string(),"0132lo232334".to_string());
        data.insert("term".to_string(),"10".to_string());
        let timestamp = std::time::SystemTime::now().duration_since(std::time::SystemTime::UNIX_EPOCH).unwrap().as_millis();
        let time_str = timestamp.to_string();
        data.insert("time".to_string(),time_str);
        data.insert("batch".to_string(),local::uuid());
        info!("11 params {:?}",data);
        println!("22 params {:?}",data);
        let rst = rt.block_on(local::fetch(url.to_string(), "json".to_string(), Some(data), Some(headers), None));
        println!(">>>>>>>>>>>>>>>>>.{:?}",rst)
    }
    #[test]
    fn get_mac(){
        // utils::log_config::init_log_config(); 、、 94330265  pc0087003736
        // let rt = Runtime::new().unwrap(); // 653c51761ab1d7ef01  
        // let rst = rt.block_on(pre_login_mac("pc0087003736",None));
        // println!("{:?}",rst);
        // info!("{:?}",rst);
    }
}